<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户信息</title>
</head>
<link href="${pageContext.request.contextPath}/css/css.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/style2.css" rel="stylesheet" type="text/css" />
</head>
<script>
/* function selectAll(){
	var obj = document.fom.elements;
	for (var i=0;i<obj.length;i++){
		if (obj[i].name == "delid"){
			obj[i].checked = true;
		}
	}
}

function unselectAll(){
	var obj = document.fom.elements;
	for (var i=0;i<obj.length;i++){
		if (obj[i].name == "delid"){
			if (obj[i].checked==true) obj[i].checked = false;
			else obj[i].checked = true;
		}
	}
}
 */

//当前第几页数据
var currentPage =${page.pageNow };
//总页数
var totalPage =${page.totalPageCount}; 
//第一页
function firstPage(){
	if(currentPage == 1){
		alert("已经是第一页数据");
		return false;
	}else{
		window.location.href="${pageContext.request.contextPath }/admin/showUser?userAccount=${userAccount}&realname=${realname}&pageNow=1";
		return true;
	}
}
//下一页
function nextPage(){
	if(currentPage == totalPage){
		alert("已经是最后一页数据");
		return false;
	}else{
		window.location.href="${pageContext.request.contextPath }/admin/showUser?userAccount=${userAccount}&realname=${realname}&pageNow=" + (currentPage+1);
		return true;
	}
}
//上一页
function previousPage(){
	if(currentPage == 1){
		alert("已经是第一页数据");
		return false;
	}else{
		window.location.href="${pageContext.request.contextPath }/admin/showUser?userAccount=${userAccount}&realname=${realname}&pageNow=" + (currentPage-1);
		return true;
	}
}
//尾页
function lastPage(){
	if(currentPage == totalPage){
		alert("已经是最后一页数据");
		return false;
	}else{
		
		window.location.href="${pageContext.request.contextPath }/admin/showUser?userAccount=${userAccount}&realname=${realname}&pageNow=" + (totalPage);
		return true;
	}
}

</script>

<body>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
          <td height="62" background="${pageContext.request.contextPath}/images/nav04.png">
		   <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
		    <tr>
			  <td width="21"><img src="${pageContext.request.contextPath}/images/ico07.gif" width="20" height="18" />
			  </td>
			  <td width="538">
			  <form action="${pageContext.request.contextPath}/admin/showUser" 
                 name="fom" method="post" >
			   用户账号：<input name="userAccount" type="text" size="12" value="${userAccount}"/>
			   用户姓名：<input name="realname" type="text" size="12" value="${realname}" />
			   <input  type="submit" class="right-button02" value="查 询" />
			   </td>
			    </form> 
		    </tr>
          </table>
        </td>
   </tr>
  <tr>
    <td><table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="40" class="font42"><table id="all" width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">
					<tr>
                    <td height="20" colspan="15" align="center" bgcolor="#EEEEEE" class="tablestyle_title">
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户详细列表</td>
                    </tr>
                  <tr>
				  <!--   <td width="6%" align="center" bgcolor="#EEEEEE">选择</td> -->
					<td width="6%" height="42" align="center" bgcolor="#EEEEEE">编号</td>
					<td width="15%" align="center"  bgcolor="#EEEEEE">用户账号</td>
                    <td width="10%" align="center"  bgcolor="#EEEEEE">用户姓名</td>
                    <td width="9%"  align="center"  bgcolor="#EEEEEE">昵称</td>
					<td width="5%"  align="center"  bgcolor="#EEEEEE">性别</td>
					<td width="15%" align="center"  bgcolor="#EEEEEE">电话</td>
					<td width="18%" align="center"  bgcolor="#EEEEEE">地址</td>
					<td width="5%"  align="center"  bgcolor="#EEEEEE">账号可用</td>
                    <td width="15%" align="center"  bgcolor="#EEEEEE">操作</td>
                  </tr>
                  <!-- 全部查询 -->
                    <c:forEach items="${userList}" var="qq" varStatus="my">
					<tr> 
					  <!-- <td align="center" bgcolor="#FFFFFF"><input type="checkbox" name="delid"/></td> -->
					  <td align="center" height="42" bgcolor="#FFFFFF">${(my.index+1)+page.pageSize*(page.pageNow-1)}</td> 
					  <td align="center" bgcolor="#FFFFFF">${qq.userAccount.userAccount}</td>
					  <td align="center" bgcolor="#FFFFFF">${qq.userDetails.realname}</td>
					  <td align="center" bgcolor="#FFFFFF">${qq.userAccount.nickname}</td>
					  <td align="center" bgcolor="#FFFFFF">
					  <c:if test="${qq.userDetails.gender==1}">
									  男</c:if>
					  <c:if test="${qq.userDetails.gender==0}">
									 女</c:if></td>
					  <td align="center" bgcolor="#FFFFFF">${qq.userDetails.phone}</td>
					  <td align="center" bgcolor="#FFFFFF">${qq.userDetails.address}</td>
					  <td align="center" bgcolor="#FFFFFF">
					       <c:if test="${qq.userAccount.valid=='T'}">
					       <img  src="${pageContext.request.contextPath}/images/yc02.png" width="20" height="20"/>
					       </c:if>
					       <c:if test="${qq.userAccount.valid=='F'}">
					       <img  src="${pageContext.request.contextPath}/images/yc01.png" width="20" height="20"/>
					       </c:if>
					     </td>
					   <td align="center" bgcolor="#FFFFFF"><a href="${pageContext.request.contextPath}/admin/deleteUser?userAccount=${qq.userAccount.userAccount}"
					   onclick="return tingyong()">停用</a>
					 |<a href="${pageContext.request.contextPath}/admin/resumeUser?userAccount=${qq.userAccount.userAccount}">恢复</a></td>
					</tr>
				  </c:forEach>
                </table></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bottom=0px>
        <tr>
          <td height="6"><img src="${pageContext.request.contextPath}/images/spacer.png" width="1" height="1" /></td>
        </tr>
        <tr>
          <td height="33"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="right-font08">
              <tr>
                <td width="50%">共 <span class="right-text09">${page.totalPageCount}</span> 页 | 第 <span class="right-text09">${page.pageNow}</span> 页</td>
                <td width="45%" align="right">
                [ <a href="#" class="right-font08" onclick="firstPage();">首页</a>
                | <a href="#" class="right-font08" onclick="previousPage();">上一页</a>
                | <a href="#" class="right-font08" onclick="nextPage();">下一页</a> 
                | <a href="#" class="right-font08" onclick="lastPage();">末页</a>
                ]</td>
                <td width="5%">
                
                </td>
              </tr>
          </table>
          </td>
        </tr>
      </table>
      </td>
  </tr>
<table>

</body>


<script type="text/javascript">
function tingyong() {
	var msg = "您确定删除该用户吗？";
	if (confirm(msg) == true) {
	} else {
		return false;
	}
}

</script>

</html>





